﻿using System;
using System.Collections.Generic;

namespace Be.Timvw.Framework.Proxies
{
    public static class LazyProxyHelper
    {
        public static IList<TResult> Create<TResult, T>(Func<IList<TResult>, T> costlyFunction, T t)
        {
            return new LazyProxy<IList<TResult>, T>(costlyFunction, t).ResultProxy;
        }

        public static TResult Create<TResult, T>(Func<TResult, T> costlyFunction, T t) where TResult : MarshalByRefObject
        {
            return new LazyProxy<TResult, T>(costlyFunction, t).ResultProxy;
        }
    }
}